import { create } from './asyncActionCreator';
import {  } from '../../../constants/API';


export const SWITCH_QUALITY_FEEDBACK_VIEW = 'switch quality feedback view';
export const switchQualityFeedbackView = (view) => ({
	type:SWITCH_QUALITY_FEEDBACK_VIEW,
	payload:{
		view
	}
});
/**
 * [GET_QUALITY_FEEDBACK_BASIC_REQUEST 请求概览]
 * @type {String}
 */
export const GET_QUALITY_FEEDBACK_BASIC_REQUEST = 'get quality feedback basic request',
			 GET_QUALITY_FEEDBACK_BASIC_SUCCESS = 'get quality feedback basic success',
			 GET_QUALITY_FEEDBACK_BASIC_FAILURE = 'get quality feedback basic failure';
export const getQualityFeedbackBasicRequest = () => ({
	type:GET_QUALITY_FEEDBACK_BASIC_REQUEST,
	payload:{}
});
export const getQualityFeedbackBasicSuccess = (dataSource) => ({
	type:GET_QUALITY_FEEDBACK_BASIC_SUCCESS,
	payload:{
		dataSource
	}
});
export const getQualityFeedbackBasicFailure = (message) => ({
	type:GET_QUALITY_FEEDBACK_BASIC_FAILURE,
	payload:{
		message
	}
});
export const getQualityFeedbackBasic = (area,params) => {
	return create(`${url}/${area}`,
		getQualityFeedbackBasicRequest,
		getQualityFeedbackBasicSuccess,
		getQualityFeedbackBasicFailure,
		params)
};
/**
 * [GET_QUALITY_FEEDBACK_DETAIL_REQUEST 请求详情]
 * @type {String}
 */
export const GET_QUALITY_FEEDBACK_DETAIL_REQUEST = 'get quality feedback detail request',
			 GET_QUALITY_FEEDBACK_DETAIL_SUCCESS = 'get quality feedback detail success',
			 GET_QUALITY_FEEDBACK_DETAIL_FAILURE = 'get quality feedback detail failure';
export const getQualityFeedbackDetailRequest = () => ({
	type:GET_QUALITY_FEEDBACK_DETAIL_REQUEST,
	payload:{}
});
export const getQualityFeedbackDetailSuccess = (dataSource) => ({
	type:GET_QUALITY_FEEDBACK_DETAIL_SUCCESS,
	payload:{
		dataSource
	}
});
export const getQualityFeedbackDetailFailure = (message) => ({
	type:GET_QUALITY_FEEDBACK_DETAIL_FAILURE,
	payload:{
		message
	}
});
export const getQualityFeedbackDetail = (area,params) => {
	return create(`${url}/${area}`,
		getQualityFeedbackDetailRequest,
		getQualityFeedbackDetailSuccess,
		getQualityFeedbackDetailFailure,
		params)
};
/**
 * [SET_QUALITY_FEEDBACK_DETAIL_PAGEINDEX 本地翻页]
 * @type {String}
 */
export const SET_QUALITY_FEEDBACK_DETAIL_PAGEINDEX = 'set quality feedback detail pageIndex',
			 SET_QUALITY_FEEDBACK_DETAIL_CURRENT_PAGEINDEX = 'set quality feedback detail current pageIndex';
export const setQualityFeedbackDetailPageIndex =(pageIndex) => ({
	type:SET_QUALITY_FEEDBACK_DETAIL_PAGEINDEX,
	payload:{
		pageIndex
	}
});
export const setQualityFeedbackDetailCurrentPageIndex =(currentPageIndex) => ({
	type:SET_QUALITY_FEEDBACK_DETAIL_CURRENT_PAGEINDEX,
	payload:{
		currentPageIndex
	}
})
		